package algorithmcase;

import java.util.Arrays;

public class Case4 {
    //冒泡排序
    public static void main(String[] args) {
        int[] arr = {27,22,30,40,36,13,19,16,20,7,10,43,50,58};
        for (int j = 0; j < arr.length-1; j++){
            for (int i = 0; i < arr.length-1-j; i++) {
                if(arr[i] > arr[i+1]){
                    int temp = arr[i];
                    arr[i] = arr[i+1];
                    arr[i+1] = temp;
                }
            }
        }

        System.out.println(Arrays.toString(arr));
    }
}
